Dear all,
I am setting up a tool length probe in combination with a spindle with manual tool change.
I want to reserve a dummy slot in the tool table, in which I want to store the machine z position in the very first probe touch with the first milling cutter ( save it in the tool length field).
When starting to replace the cutter with other ones, I use the reference stored in the dummy slot to calculate the tool length for tool length compensation.
In the program I use
GetMiscSettings(&Units, &TWORD, &HWORD, &DWORD);
to find out about the currently selected tool.
The following questions came up..
1) is TWORD an integer of the slot number?
2) in init-file, I want to hardcode to use tool id 1001 (slot 1) as default. What would be the appropriate function for that?
3) when writing
SetToolLength(TWORD,NewToolLength);
does this immediately affect the DRO (the one with G54)? Or do I have to activate somehow?
4) if TWORD is an integer of the slot, then I could define tool length of dummy slot 99 by
SetToolLength(99,NewToolLength);
Is that correct?
5) In KmotionCNC, I switched on "Tool Length/Offset immediately" on Trajectory Planner page. However, the compensation becomes only active in the DRO (G54), when I activate the tool by "G43 H1001" in gcode. Am I doing something wrong or is this a normal behavior?
6) finally, when using Move(x,x) in c-program, are soft limits active? This is just a safety question, since I might mess up the way I want to move the spindle to xyz of the probe..:)
Thanks a lot in advance!
Kind regards,
Johannes
PS the core of the probe-c-program should look something like this:
GetMiscSettings(&Units, &TWORD, &HWORD, &DWORD);
GetToolLength(TWORD, &Length1);
GetToolLength(99, &Length2);
if (Length2 == -50.0){
/* this should happen only at first probe measurement;
length of tool 1 set to 0.0 and length of tool 99 set to -50.0 in the init file
*/
SetToolLength(99,znew/ZPULSEperMM); // save the absolute machine z-position in mm
}else{
/* this should happen from second measurement on;
tool length 1 is calculated relative to very first probe measurement
*/
NewToolLength = znew/ZPULSEperMM - Length1; // tool length is diff. between new and old abs. position
SetToolLength(TWORD,NewToolLength); // set the new toollength
}